package com.sls.web.manager.action.game;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.springframework.beans.factory.annotation.Value;

import com.sls.web.manager.action.SuperAction;
import com.sls.web.manager.common.Constants;
import com.sls.web.manager.execption.ManagerException;
import com.sls.web.manager.game.parser.MapUtil;
import com.sls.web.manager.game.parser.ParseXmlDocument;
import com.sls.web.manager.game.parser.ZipUtil;
import com.sls.web.manager.game.pojo.xqt.XQTAccountTypeInfo;
import com.sls.web.manager.game.pojo.xqt.XQTChargetypeInfo;
import com.sls.web.manager.game.pojo.xqt.XQTDiscountInfo;
import com.sls.web.manager.game.pojo.xqt.XQTGameAreaServerInfo;
import com.sls.web.manager.game.pojo.xqt.XQTOrderQueryInfo;
import com.sls.web.manager.game.pojo.xqt.XQTParvalueInfo;
import com.sls.web.manager.game.pojo.xqt.XQTTopInfo;
import com.sls.web.manager.game.querybean.XQTAccountTypeQuery;
import com.sls.web.manager.game.querybean.XQTChargeTypeQuery;
import com.sls.web.manager.game.querybean.XQTDiscountQuery;
import com.sls.web.manager.game.querybean.XQTGameAreaServerQuery;
import com.sls.web.manager.game.querybean.XQTParvalueQuery;
import com.sls.web.manager.game.querybean.XQTTopQuery;
import com.sls.web.manager.game.service.XQTService;
import com.sls.web.manager.page.Pagination;

/**
 * 星启天产品管理
 * 
 * @author cx
 * 
 */
@InterceptorRefs({
		@InterceptorRef(value = "defaultStack", params = { "maximumSize",
				"2048000", "allowedTypes",
				"text/plain,application/excel,application/vnd.ms-excel" }),
		@InterceptorRef(value = "defalutStackSet") })
public class XqtAction extends SuperAction {
	private static final long serialVersionUID = 8798028821670752209L;
	@Resource(name = "xQTService")
	private XQTService xqtService;
	private XQTParvalueQuery parvalueQuery;
	private XQTGameAreaServerQuery areaServerQuery;
	private XQTDiscountQuery discountQuery;
	private XQTChargeTypeQuery chargeTypeQuery;
	private XQTAccountTypeQuery accountTypeQuery;
	private XQTTopQuery topQuery;
	private XQTParvalueInfo parvalueInfo;
	private XQTChargetypeInfo chargeTypeInfo;
	private XQTGameAreaServerInfo areaServerInfo;
	private XQTOrderQueryInfo queryInfo;
	private Pagination<?> page;
	private String id;
	private String supplierId;
	private int priceRatio;
	private String merchantid;
	private String tranid;
	// 用于文件上传
	private File xml;
	private String xmlFileName;
	private String xmlContentType;
	private File excel;// 获取上传文件
	private String excelFileName;// 获取上传文件名称
	private String excelContentType;// 获取上传文件类型
	
	@Value("${xqt.merchant.id}")
//	private String merchantIdStr;
	private String[] merchantIds;

	/**
	 * 产品面值信息列表
	 * 
	 * @return
	 */
	public String parvalueList() throws Exception {
		if (parvalueQuery == null) {
			parvalueQuery = new XQTParvalueQuery();
			parvalueQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			parvalueQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		try {
			page = this.xqtService.queryParvalueInfo(parvalueQuery,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}

		return "parvalue_list";
	}

	/**
	 * 详情显示
	 * 
	 * @return
	 */
	public String parvalueDetail() throws Exception {
		try {
			parvalueInfo = this.xqtService.queryParvalueById(id,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}
		return "parvalue_detail";
	}

	/**
	 * 区服列表
	 * 
	 * @return
	 * @throws Exception
	 */
	public String asList() throws Exception {
		if (areaServerQuery == null) {
			areaServerQuery = new XQTGameAreaServerQuery();
			areaServerQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			areaServerQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		try {
			page = this.xqtService.queryAreaServerInfo(areaServerQuery,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}

		return "as_list";
	}

	/**
	 * 区服详情
	 * 
	 * @return
	 * @throws Exception
	 */
	public String asDetail() throws Exception {
		try {
			areaServerInfo = this.xqtService.queryDetailAreaServerInfo(id,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}
		return "as_detail";
	}

	/**
	 * 产品折扣率信息列表
	 * 
	 * @return
	 * @throws Exception
	 */
	public String discountList() throws Exception {
		if (discountQuery == null) {
			discountQuery = new XQTDiscountQuery();
			discountQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			discountQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		try {
			page = this.xqtService.queryDiscountInfo(discountQuery,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}
		return "discount_list";
	}

	/**
	 * 充值类型列表
	 * 
	 * @return
	 * @throws Exception
	 */
	public String chargeTypeList() throws Exception {
		if (chargeTypeQuery == null) {
			chargeTypeQuery = new XQTChargeTypeQuery();
			chargeTypeQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			chargeTypeQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		try {
			page = this.xqtService.queryChargeTypeInfo(chargeTypeQuery,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}

		return "charge_type_list";
	}

	/**
	 * 产品充值类型详情查询
	 * 
	 * @return
	 * @throws Exception
	 */
	public String chargeTypeDetail() throws Exception {
		try {
			chargeTypeInfo = this.xqtService.queryDetailChargeTypeInfo(id,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}
		return "charge_type_detail";
	}

	/**
	 * 账号信息列表
	 * 
	 * @return
	 * @throws Exception
	 */
	public String accountTypeList() throws Exception {
		if (accountTypeQuery == null) {
			accountTypeQuery = new XQTAccountTypeQuery();
			accountTypeQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			accountTypeQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		try {
			page = this.xqtService.queryAccountTypeInfo(accountTypeQuery,
					getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}

		return "account_type_list";
	}

	/**
	 * 头信息列表
	 * 
	 * @return
	 * @throws Exception
	 */
	public String topList() throws Exception {
		if (topQuery == null) {
			topQuery = new XQTTopQuery();
			topQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
			topQuery.setPageSize(Constants.INIT_PAGESIZE);
		}
		try {
			page = this.xqtService.queryTopInfo(topQuery, getCurrentOperator());
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}

		return "top_list";
	}

	/**
	 * 商品审核
	 * 
	 * @return
	 * @throws Exception
	 */
	public String audit() throws Exception {
		try {
			this.xqtService.confirmAudit(supplierId, priceRatio,
					getCurrentOperator());
			redirectionUrl = "xqt!parvalueList.htm";
		} catch (ManagerException e) {
			flag = false;
			addActionError(e.getMessage());
		}
		return "audit_success";
	}

	/**
	 * 批量上架
	 * 
	 * @return
	 * @throws Exception
	 */
	public String batchOnline() throws Exception {
		try {
			this.xqtService.batchOnline("1", getCurrentOperator());
			redirectionUrl = "xqt!parvalueList.htm";
		} catch (ManagerException e) {
			flag = false;
			addActionError(e.getMessage());
		}
		return SUCCESS;
	}

	/**
	 * 批量下架
	 * 
	 * @return
	 * @throws Exception
	 */
	public String batchOffline() throws Exception {
		try {
			this.xqtService.batchOffline("0", getCurrentOperator());
			redirectionUrl = "xqt!parvalueList.htm";
		} catch (ManagerException e) {
			flag = false;
			addActionError(e.getMessage());
		}
		return SUCCESS;
	}

	public String toOrderQuery() {
		return "order_query";
	}

	/**
	 * 订单查询
	 * 
	 * @return
	 * @throws Exception
	 */
	public String orderQuery() throws Exception {
		try {
			queryInfo = this.xqtService.orderQuery(merchantid, tranid,
					getCurrentOperator());
			if (queryInfo != null) {
				if (StringUtils.isEmpty(queryInfo.getTranidValue())) {
					queryInfo.setTranidValue(tranid);
				}
			}
			queryInfo.setMerchantid(merchantid);
		} catch (ManagerException e) {
			addActionError(e.getMessage());
		}
		return "order_query";
	}

	/**
	 * 导入gameid.xml文件
	 * 
	 * @return
	 * @throws Exception
	 */
	public String importGameidXmlFile() throws Exception {
		if (StringUtils.isEmpty(xmlFileName)) {
			flag = false;
			addActionError("请选择要导入的文件!");
			return SUCCESS;
		}
		if (!xmlFileName.endsWith(".xml")) {
			flag = false;
			addActionError("文件类型有误!<br>必须为xml文件!");
			return SUCCESS;
		}
		List<XQTDiscountInfo> disList = ParseXmlDocument.parseGameIdXml(xml);
		try {
			if (disList != null && !disList.isEmpty()) {
				for (XQTDiscountInfo info : disList) {
					this.xqtService.saveOfDiscount(info, getCurrentOperator());
				}
			}
			redirectionUrl = "xqt!discountList.htm";
		} catch (ManagerException e) {
			flag = false;
			addActionError(e.getMessage());
			return SUCCESS;
		}

		return SUCCESS;
	}

	/**
	 * 导入产品折扣更新文件
	 * 
	 * @return
	 * @throws Exception
	 */
	public String importExcelFile() throws Exception {
		if (StringUtils.isEmpty(excelFileName)) {
			flag = false;
			addActionError("请选择要导入的文件!");
			return SUCCESS;
		}
		if (!excelFileName.endsWith(".xls") && !excelFileName.endsWith(".xlsx")) {
			flag = false;
			addActionError("文件类型有误!<br>必须为excel文件!");
			return SUCCESS;
		}
		InputStream is = null;
		try {
			is = new FileInputStream(excel);
		} catch (FileNotFoundException e1) {
			flag = false;
			addActionError(e1.getMessage());
			return SUCCESS;
		}
		List<XQTDiscountInfo> list = null;
		try {
			if (is != null) {
				if (excelFileName.endsWith(".xls")) {
					list = this.extractListFromXLS2003(is);
				} else if (excelFileName.endsWith(".xlsx")) {
					list = this.extractListFromXLS2007(is);
				}
			}
		} catch (IOException e) {
			flag = false;
			addActionError(e.getMessage());
			return SUCCESS;
		}
		String message = "";
		if (list != null && !list.isEmpty()) {
			for (XQTDiscountInfo info : list) {
				try {
					this.xqtService.updateSalePrice(info, getCurrentOperator());
				} catch (ManagerException e) {
					message += info.getRecordProid() + "," + e.getMessage()
							+ "<br>";
					continue;
				}
			}
			if (StringUtils.isNotEmpty(message)) {
				flag = false;
				addActionError(message);
				return SUCCESS;
			}
		}
		this.redirectionUrl = "xqt!discountList.htm";
		return SUCCESS;
	}

	/**
	 * 文件导入
	 * 
	 * @return
	 * @throws Exception
	 */
	public String importXmlFile() throws Exception {
		if (StringUtils.isEmpty(xmlFileName)) {
			flag = false;
			addActionError("请选择要导入的文件!");
			return SUCCESS;
		}
		if (!xmlFileName.endsWith(".zip")) {
			flag = false;
			addActionError("文件类型有误!<br>必须为zip文件!");
			return SUCCESS;
		}

		URL url = Thread.currentThread().getContextClassLoader()
				.getResource("");
		URI uri = new URI(url.toURI().toString() + "upload");
		File dir = new File(uri);
		if (!dir.exists()) {
			dir.mkdirs();
		}
		String filePath = dir.getAbsolutePath() + File.separator + xmlFileName;
		try {
			upload(dir);
		} catch (FileNotFoundException e) {
			flag = false;
			addActionError("上传文件异常!");
			return SUCCESS;
		}

		List<File> fileList = null;
		try {
			ZipUtil.unZip(filePath, dir.getAbsolutePath());
			fileList = ZipUtil.readFloder(dir.getAbsolutePath());
		} catch (Exception e) {
			flag = false;
			addActionError("解压zip文件异常!");
			return SUCCESS;
		}
		try {
			if (fileList != null && !fileList.isEmpty()) {
				this.readFileList(fileList);
			}
		} catch (ManagerException e) {
			flag = false;
			addActionError(e.getMessage());
			return SUCCESS;
		}
		this.deleteDirectory(dir.getAbsolutePath());
		redirectionUrl = "xqt!parvalueList.htm";
		return SUCCESS;
	}

	/**
	 * 上传文件
	 * 
	 * @param dir
	 * @throws FileNotFoundException
	 * @throws IOException
	 */
	private void upload(File dir) throws FileNotFoundException, IOException {
		InputStream is = new FileInputStream(xml);
		File deskFile = new File(dir.getAbsolutePath(), xmlFileName);
		OutputStream os = new FileOutputStream(deskFile);
		byte[] bytefer = new byte[1024];
		int length = 0;
		while ((length = is.read(bytefer)) > 0) {
			os.write(bytefer, 0, length);
		}
		os.close();
		is.close();
	}

	/**
	 * 读取文件列表
	 * 
	 * @param fileList
	 * @throws Exception
	 */
	private void readFileList(List<File> fileList) throws Exception {
		if (fileList != null && !fileList.isEmpty()) {
			for (File file : fileList) {
				Map<String, List<Object>> map = ParseXmlDocument.parse(file);
				List<XQTParvalueInfo> parvalueList = MapUtil
						.getParvalueListFromMap(map);
				this.saveParvalueListToServer(parvalueList);
				List<XQTChargetypeInfo> chargeTypeList = MapUtil
						.getChargeTypeListFromMap(map);
				this.saveChargetypeListToServer(chargeTypeList);
				XQTTopInfo topInfo = MapUtil.getTopInfoFromMap(map);
				this.saveTopInfoToServer(topInfo);
				List<XQTAccountTypeInfo> accountTypeList = MapUtil
						.getAccountTypeInfoListFromMap(map);
				this.saveAccountListToServer(accountTypeList);
				List<XQTGameAreaServerInfo> areaServerList = MapUtil
						.getAreaServerInfoListFromMap(map);
				this.saveAreaServerListToServer(areaServerList);
			}
		}
	}

	/**
	 * 保存区服信息
	 * 
	 * @param areaServerList
	 * @throws Exception
	 */
	private void saveAreaServerListToServer(
			List<XQTGameAreaServerInfo> areaServerList) throws Exception {
		if (areaServerList != null && !areaServerList.isEmpty()) {
			for (XQTGameAreaServerInfo asInfo : areaServerList) {
				this.xqtService.saveOfAreaSrv(asInfo, getCurrentOperator());
			}
		}
	}

	/**
	 * 保存账户信息
	 * 
	 * @param accountTypeList
	 * @throws Exception
	 */
	private void saveAccountListToServer(
			List<XQTAccountTypeInfo> accountTypeList) throws Exception {
		if (accountTypeList != null && !accountTypeList.isEmpty()) {
			for (XQTAccountTypeInfo accountInfo : accountTypeList) {
				this.xqtService.saveOfAccountType(accountInfo,
						getCurrentOperator());
			}
		}
	}

	/**
	 * 保存文件中的头部信息
	 * 
	 * @param topInfo
	 * @throws Exception
	 */
	private void saveTopInfoToServer(XQTTopInfo topInfo) throws Exception {
		if (topInfo != null) {
			this.xqtService.saveOfGoodsTop(topInfo, getCurrentOperator());
		}

	}

	/**
	 * 保存充值类型信息
	 * 
	 * @param chargeTypeList
	 * @throws Exception
	 */
	private void saveChargetypeListToServer(
			List<XQTChargetypeInfo> chargeTypeList) throws Exception {
		if (chargeTypeList != null && !chargeTypeList.isEmpty()) {
			for (XQTChargetypeInfo chargeInfo : chargeTypeList) {
				this.xqtService.saveOfChargeType(chargeInfo,
						getCurrentOperator());
			}
		}
	}

	/**
	 * 保存产品面值信息
	 * 
	 * @param parvalueList
	 * @throws Exception
	 */
	private void saveParvalueListToServer(List<XQTParvalueInfo> parvalueList)
			throws Exception {
		if (parvalueList != null && !parvalueList.isEmpty()) {
			for (XQTParvalueInfo parvalueInfo : parvalueList) {
				this.xqtService.saveOfParvalue(parvalueInfo,
						getCurrentOperator());
			}
		}
	}

	/**
	 * 删除文件夹
	 * 
	 * @param filePath
	 */
	private void deleteDirectory(String filePath) {
		String cmdStr = "";
		String os = getOS();
		if (os.contains("Windows")) {
			cmdStr = "cmd /c rmdir /q/s " + filePath;
		} else if (os.contains("Linux")) {
			cmdStr = "rm -rf " + filePath;
		}
		final String cmd = cmdStr;
		Process p = null;
		try {
			p = Runtime.getRuntime().exec(cmd);
			int i = p.waitFor();// 挂起等待
			if (i != 0) {
				log.error("命令执行失败!");
			}
			if (p != null) {
				p.destroy();
				p = null;
			}
		} catch (Exception e) {
			log.error(e);
		}
	}

	/**
	 * 判断操作系统
	 * 
	 * @return
	 */
	private String getOS() {
		String os = "";
		if ("\\".equals(File.separator)) {
			os = "Windows";
		} else if ("/".equals(File.separator)) {
			os = "Linux";
		}
		return os;
	}

	private List<XQTDiscountInfo> extractListFromXLS2003(InputStream is)
			throws IOException {
		List<XQTDiscountInfo> list = new ArrayList<XQTDiscountInfo>();
		XQTDiscountInfo disInfo = null;
		HSSFWorkbook workbook = new HSSFWorkbook(is); // 创建对Excel工作簿文件的引用
		for (int numSheets = 0; numSheets < workbook.getNumberOfSheets(); numSheets++) {
			if (null != workbook.getSheetAt(numSheets)) {
				HSSFSheet aSheet = workbook.getSheetAt(numSheets); // 获得一个sheet
				for (int rowNumOfSheet = 1; rowNumOfSheet <= aSheet
						.getLastRowNum(); rowNumOfSheet++) {
					if (null != aSheet.getRow(rowNumOfSheet)) {
						disInfo = new XQTDiscountInfo();
						List<String> cellList = new ArrayList<String>();
						HSSFRow aRow = aSheet.getRow(rowNumOfSheet); // 获得一行
						for (int cellNumOfRow = 0; cellNumOfRow <= aRow
								.getLastCellNum(); cellNumOfRow++) {
							if (null != aRow.getCell(cellNumOfRow)) {
								HSSFCell aCell = aRow.getCell(cellNumOfRow); // 获得列值
								if (aCell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) {
									double parvalue = aCell
											.getNumericCellValue();
									cellList.add(String.valueOf(parvalue));
								} else if (aCell.getCellType() == HSSFCell.CELL_TYPE_BOOLEAN) {
									boolean flag = aCell.getBooleanCellValue();
									cellList.add(String.valueOf(flag));
								} else {
									cellList.add(aCell.getStringCellValue());
								}

								if (cellList.size() > 0) {
									disInfo.setRecordProid(cellList.get(0));
								}
								if (cellList.size() > 1) {
									String salePrice = cellList.get(1);
									double d = Double.parseDouble(salePrice);
									DecimalFormat df = new DecimalFormat("#.00");
									d = d * 100;
									disInfo.setRecordSalePrice(df.format(d));
								}

							}
						}

					}
					list.add(disInfo);
				}
			}
		}
		return list;
	}

	/**
	 * 解析excel2007文件
	 * 
	 * @param is
	 * @return
	 * @throws IOException
	 * @throws Exception
	 */
	private List<XQTDiscountInfo> extractListFromXLS2007(InputStream is)
			throws IOException {
		List<XQTDiscountInfo> list = new ArrayList<XQTDiscountInfo>();
		XQTDiscountInfo disInfo = null;
		// 构造 XSSFWorkbook 对象，strPath
		// 传入文件路径
		XSSFWorkbook xwb = new XSSFWorkbook(is);
		// 循环工作表Sheet
		for (int numSheet = 0; numSheet < xwb.getNumberOfSheets(); numSheet++) {
			XSSFSheet xSheet = xwb.getSheetAt(numSheet);
			if (xSheet == null) {
				continue;
			}
			// 循环行Row
			for (int rowNum = 1; rowNum <= xSheet.getLastRowNum(); rowNum++) {
				disInfo = new XQTDiscountInfo();
				XSSFRow xRow = xSheet.getRow(rowNum);
				if (xRow == null) {
					continue;
				}
				List<String> cellList = new ArrayList<String>();
				// 循环列Cell
				for (int cellNum = 0; cellNum <= xRow.getLastCellNum(); cellNum++) {
					XSSFCell xCell = xRow.getCell(cellNum);

					if (xCell == null) {
						continue;
					}
					if (xCell.getCellType() == XSSFCell.CELL_TYPE_BOOLEAN) {
						boolean flag = xCell.getBooleanCellValue();
						cellList.add(String.valueOf(flag));
					} else if (xCell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
						double parvalue = xCell.getNumericCellValue();
						cellList.add(String.valueOf(parvalue));
					} else {
						cellList.add(xCell.getStringCellValue());
					}
					if (cellList.size() > 0) {
						disInfo.setRecordProid(cellList.get(0));
					}
					if (cellList.size() > 1) {
						String salePrice = cellList.get(1);
						double d = Double.parseDouble(salePrice);
						DecimalFormat df = new DecimalFormat("#.00");
						d = d * 100;
						disInfo.setRecordSalePrice(df.format(d));
					}
				}
				list.add(disInfo);
			}
		}
		return list;
	}

	public XQTParvalueQuery getParvalueQuery() {
		return parvalueQuery;
	}

	public void setParvalueQuery(XQTParvalueQuery parvalueQuery) {
		this.parvalueQuery = parvalueQuery;
	}

	public XQTGameAreaServerQuery getAreaServerQuery() {
		return areaServerQuery;
	}

	public void setAreaServerQuery(XQTGameAreaServerQuery areaServerQuery) {
		this.areaServerQuery = areaServerQuery;
	}

	public XQTDiscountQuery getDiscountQuery() {
		return discountQuery;
	}

	public void setDiscountQuery(XQTDiscountQuery discountQuery) {
		this.discountQuery = discountQuery;
	}

	public XQTChargeTypeQuery getChargeTypeQuery() {
		return chargeTypeQuery;
	}

	public void setChargeTypeQuery(XQTChargeTypeQuery chargeTypeQuery) {
		this.chargeTypeQuery = chargeTypeQuery;
	}

	public XQTAccountTypeQuery getAccountTypeQuery() {
		return accountTypeQuery;
	}

	public void setAccountTypeQuery(XQTAccountTypeQuery accountTypeQuery) {
		this.accountTypeQuery = accountTypeQuery;
	}

	public XQTTopQuery getTopQuery() {
		return topQuery;
	}

	public void setTopQuery(XQTTopQuery topQuery) {
		this.topQuery = topQuery;
	}

	public Pagination<?> getPage() {
		return page;
	}

	public void setPage(Pagination<?> page) {
		this.page = page;
	}

	public XQTParvalueInfo getParvalueInfo() {
		return parvalueInfo;
	}

	public void setParvalueInfo(XQTParvalueInfo parvalueInfo) {
		this.parvalueInfo = parvalueInfo;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(String supplierId) {
		this.supplierId = supplierId;
	}

	public int getPriceRatio() {
		return priceRatio;
	}

	public void setPriceRatio(int priceRatio) {
		this.priceRatio = priceRatio;
	}

	public File getXml() {
		return xml;
	}

	public void setXml(File xml) {
		this.xml = xml;
	}

	public String getXmlFileName() {
		return xmlFileName;
	}

	public void setXmlFileName(String xmlFileName) {
		this.xmlFileName = xmlFileName;
	}

	public String getXmlContentType() {
		return xmlContentType;
	}

	public void setXmlContentType(String xmlContentType) {
		this.xmlContentType = xmlContentType;
	}

	public XQTChargetypeInfo getChargeTypeInfo() {
		return chargeTypeInfo;
	}

	public void setChargeTypeInfo(XQTChargetypeInfo chargeTypeInfo) {
		this.chargeTypeInfo = chargeTypeInfo;
	}

	public File getExcel() {
		return excel;
	}

	public void setExcel(File excel) {
		this.excel = excel;
	}

	public String getExcelFileName() {
		return excelFileName;
	}

	public void setExcelFileName(String excelFileName) {
		this.excelFileName = excelFileName;
	}

	public String getExcelContentType() {
		return excelContentType;
	}

	public void setExcelContentType(String excelContentType) {
		this.excelContentType = excelContentType;
	}

	public XQTGameAreaServerInfo getAreaServerInfo() {
		return areaServerInfo;
	}

	public void setAreaServerInfo(XQTGameAreaServerInfo areaServerInfo) {
		this.areaServerInfo = areaServerInfo;
	}

	public XQTOrderQueryInfo getQueryInfo() {
		return queryInfo;
	}

	public void setQueryInfo(XQTOrderQueryInfo queryInfo) {
		this.queryInfo = queryInfo;
	}

	public String getMerchantid() {
		return merchantid;
	}

	public void setMerchantid(String merchantid) {
		this.merchantid = merchantid;
	}

	public String getTranid() {
		return tranid;
	}

	public void setTranid(String tranid) {
		this.tranid = tranid;
	}

	public String[] getMerchantIds() {
		return merchantIds;
	}

	public void setMerchantIds(String[] merchantIds) {
		this.merchantIds = merchantIds;
	}

}
